<?php

namespace App\Models\Common;

class Constant
{
    //手机正则
    const PHONE_PREG = "/^1[3-9]\d{9}$/";
    // 时:分正则
    const TIME_PREG = "/^(20|21|22|23|[0-1]\d):[0-5]\d$/";

    // 队列
    //通知
    const QUEUE_NOTIFICATION = 'notification';
    //设备记录
    const QUEUE_RECORDS = 'records';
    //支付
    const QUEUE_PAYMENT = 'payment';
    //混合
    const QUEUE_MIXED = 'mixed';
    //单例
    const QUEUE_SINGLE = 'single';
    //默认
    const QUEUE_DEFAULT = 'default';

    const CAR_NO_TYPE_BLUE = '蓝牌车';
    const CAR_NO_TYPE_YELLOW = '黄牌车';
    const CAR_NO_TYPE_GREEN = '绿牌车';
    const CAR_NO_TYPE_BLACK = '黑牌车';
    const CAR_NO_TYPE_WHITE = '白牌车';
    const CAR_NO_TYPE_NO = '无牌车';
    const CAR_NO_TYPE_S1 = '警车';
    const CAR_NO_TYPE_S2 = '军车';
    const CAR_NO_TYPE_S3 = '使馆车';
    const CAR_NO_TYPES = [
        self::CAR_NO_TYPE_BLUE,
        self::CAR_NO_TYPE_YELLOW,
        self::CAR_NO_TYPE_GREEN,
//        self::CAR_NO_TYPE_BLACK,
//        self::CAR_NO_TYPE_WHITE,
        self::CAR_NO_TYPE_NO,
        self::CAR_NO_TYPE_S1,
        self::CAR_NO_TYPE_S2,
        self::CAR_NO_TYPE_S3,
    ];
    const CAR_NO_TYPE_S = [
        self::CAR_NO_TYPE_S1 => 1,
        self::CAR_NO_TYPE_S2 => 2,
        self::CAR_NO_TYPE_S3 => 3,
    ];

    const CACEH_KEY_PARK_ORDER_PAY_LOCK = '_park_order_lock'; // 缓存锁-临停订单支付锁
    const CACHE_KEY_COUPON_BUY_FREE = '_coupon_buy_free'; // 优惠券零元购频率限制
    const CACHE_KEY_HOLIDAY_ABLE = '_holiday_able'; // 停车开启假日模式
    const CACHE_KEY_TODAY_IS_HOLIDAY = '_today_is_holiday'; // 停车 今日为节假日
    const CACHE_KEY_BATCH_SYNC_MTH_CARD = '_batch_sync_mth_card'; // 批量同步月卡频率限制
    const CACHE_KEY_AREA_TEM_CAR_NUM = '_area_tem_car_num'; // 区域临停车数量
    const CACHE_KEY_AREA_MTH_CAR_NUM = '_area_mth_car_num'; // 区域月租车数量
    const CACHE_KEY_NO_PLATE_INTO = '_no_plate_into'; // 无牌车入场
    const CACHE_KEY_PARKING_LOT_SETTINGS = '_parking_lot_settings'; // 车场配置参数
    const CACHE_KEY_ETC_SETTINGS = '_etc_settings'; // 车场ETC配置参数
    const CACHE_KEY_DEVICE_CAR_NOTIFY = '_device_car_'; // 设备识别车辆缓存
    const CACHE_KEY_CHARGE_PLATE_NOTIFY = '_charge_plate_'; // 车辆充电记录缓存
    const CACHE_KEY_CHARGE_DISCOUNT_ABLE = '_charge_discount_able'; //  开启充电减免
    const NOT_ENTER_CAR_OUT = '_not_enter_car_out'; // 不在场车辆出场-提示重新识别
    const LANE_OUT_CAR = '_lane_out_car'; // 车道出场车辆
    const LANE_ENTER_CAR = '_lane_enter_car'; // 车道入场车辆

    const SOURCE_APP = 'APP';
    const SOURCE_ADMIN = 'ADMIN';

    // 订单状态
    const ORDER_STATUS_UNPAID = 'UNPAID';
    const ORDER_STATUS_PAID = 'PAID';
    const ORDER_STATUS_CLOSED = 'CLOSED';
    const ORDER_STATUS = [
        '待支付' => self::ORDER_STATUS_UNPAID,
        '已支付' => self::ORDER_STATUS_PAID,
        '已关闭' => self::ORDER_STATUS_CLOSED,
    ];

    // 支付方式
    const PAY_TYPE_ALIPAY = 'ALIPAY';
    const PAY_TYPE_WECHATPAY = 'WECHATPAY';
    const PAY_TYPE_CASH = 'CASH';
    const PAY_TYPE_CARD = 'CARD';
    const PAY_TYPE_QUICK_PASS = 'QUICK_PASS';
    const PAY_TYPE_COUPON = 'COUPON';
    const PAY_TYPE_MERCHANT_BALANCE = 'MERCHANT_BALANCE';
    const PAY_TYPE_STORE_CAR_BALANCE = 'STORE_CAR_BALANCE';
    const PAY_TYPE_XL_ETC = 'XL_ETC';
    const PAY_TYPE_EBANK_ETC = 'EBANK_ETC';
    const PAY_TYPE_CHARGE_DISCOUNT = 'CHARGE_DISCOUNT';

    const PAY_TYPES = [
        '支付宝支付' => self::PAY_TYPE_ALIPAY,
        '微信支付' => self::PAY_TYPE_WECHATPAY,
        '现金支付' => self::PAY_TYPE_CASH,
        '刷卡支付' => self::PAY_TYPE_CARD,
        '云闪付' => self::PAY_TYPE_QUICK_PASS,
        '优惠券抵扣' => self::PAY_TYPE_COUPON,
        '商户余额' => self::PAY_TYPE_MERCHANT_BALANCE,
        '特殊车余额' => self::PAY_TYPE_STORE_CAR_BALANCE,
        '信联ETC' => self::PAY_TYPE_XL_ETC,
        '城商行ETC' => self::PAY_TYPE_EBANK_ETC,
        '充电减免' => self::PAY_TYPE_CHARGE_DISCOUNT,
    ];

    const SELECT_ABLE = [
        self::PAY_TYPE_ALIPAY,
        self::PAY_TYPE_WECHATPAY,
        self::PAY_TYPE_CASH,
        self::PAY_TYPE_CARD,
    ];

    const COUPON_DISCOUNT_TYPES = [
        1 => '金额',
        2 => '时长',
        3 => '全免',
        4 => '折扣'
    ];
}
